﻿@using VirtualPress.Infrastructure.Entities.Entity;
@using VirtualPress.Infrastructure.Entities.Enum;
@{
    Periodical jounal = ViewBag.Journal;
    ViewBag.Title = "稿件库 -- " + jounal.Name;
    Layout = "/Areas/WorkSpace/Views/Shared/_WorkSpace.cshtml";
}
@{
    ItemListBox<Article> articles = ViewBag.Article;
}
@section head{
<style type="text/css">
.dropdown-menu>li>a{
text-align:left;
}
.dropdown-menu>li>a:hover, .dropdown-menu>li>a:focus, .dropdown-submenu:hover>a, .dropdown-submenu:focus>a {
color: #fff;
text-decoration: none;
background-color: #0081c2;
background-image: -moz-linear-gradient(top,#08c,#0077b3);
background-image: -webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));
background-image: -webkit-linear-gradient(top,#08c,#0077b3);
background-image: -o-linear-gradient(top,#08c,#0077b3);
background-image: linear-gradient(to bottom,#08c,#0077b3);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0);

}

</style>
}
<div id="content-header">
    <h1>
        稿件库</h1>
</div>
<div id="breadcrumb">
    <a href="/WorkSpace/console/index" class="tip-bottom"><i class="icon-home"></i>起始页</a> <a href="javascript:"
        class="current">稿件库</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <span style="font-size: 10px; color: Red;">注：如果您误删稿件，请联系管理员处理。</span>
            <div class="widget-box" style="margin-top: 0px;">
                <div class="widget-title">
                    <h5>
                        最新稿件</h5>
                    <div class="buttons" style="margin-right: 15px;">
                        <a href="/workspace/console/manualArticle" class="btn btn-success btn-mini"><i class="icon-plus icon-white">
                        </i>添加稿件</a>
                    </div>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered">
                        <thead>
                            <tr style="cursor: pointer;">
                                <th>
                                    标题
                                </th>
                                <th style="width: 20%">
                                    作者
                                </th>
                                <th style="width: 15%">
                                    稿件状态
                                </th>
                                <th style="width: 15%">
                                    期刊
                                </th>
                                <th style="width: 10%">
                                    来稿时间
                                </th>
                                <th style="width: 20%">
                                    操作
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            @{
                                PeriodicalItem journalItem = ViewBag.JournalItem;
                                if (articles != null && articles.Data != null &&
                                    articles.Data.Any())
                                {
                                    foreach (var item in articles.Data)
                                    {
                                <tr>
                                    <td>
                                        <a target="_blank" href="/workspace/console/articledetail/@item.Id">@item.Title</a>
                                    </td>
                                    <td style="text-align: center">
                                        @{string authors = string.Empty;
                                          item.ArticleAuthor.ForEach(
                                          c => { authors += c.AuthorName + "， "; });
                                          authors = authors.Trim();
                                          authors = authors.Remove(authors.Length - 1); }
                                        @authors
                                    </td>
                                    <td style="text-align: center">
                                        @item.Status.Mapping()
                                    </td>
                                    <td style="text-align: center">
                                        @item.Journal.Name
                                    </td>
                                    <td style="text-align: center">
                                        @item.CreateTime.ToString("yyyy-MM-dd")
                                    </td>
                                    <td style="text-align: center; overflow:visible;">
                                        @if (item.IsDelete)
                                        {
                                            <i>稿件已删除</i>
                                        }
                                        else
                                        {
                                            if (journalItem != null && item.PeriItem_Id == 0)
                                            {
                                                <div class="btn-group">
									              <button data-toggle="dropdown" class="btn btn-primary dropdown-toggle">选定出版 <span class="caret"></span></button>
                                                  <ul class="dropdown-menu">
										            <li><a href="/workspace/console/addArticleToPublish?articleId=@item.Id&journalItemId=@journalItem.Id">@Html.Raw("于第 "+journalItem.Manuscriptcode+" 期")</a></li>
										            <li class="divider"></li>
										            <li><a href="/workspace/console/publish">其他期</a></li>
									              </ul>
									            </div>
                                            }
                                            if(item.PeriItem_Id > 0)
                                            {
                                                <span class="label label-info">@Html.Raw("准备于"+item.Peri_Item_Code+"期出版")</span>
                                            }
                                            <a target="_blank" href="/workspace/console/articledetail/@item.Id" class="btn btn-success">
                                                查看</a>
                                        }
                                    </td>
                                </tr>
                                    }
                                }
                            }
                        </tbody>
                    </table>
                </div>
                @Html.Raw(articles.PageItemSegment)
            </div>
        </div>
    </div>
</div>
@section tail{
<script type="text/javascript">
    $(function () {
        $('#likpublish').addClass('open active');
    });
</script>
}